Optimal. Leaf size=204 \[ \frac {(g \cos (e+f x))^{-m-n} (a+a \sin (e+f x))^m (c-c \sin (e+f x))^{-2+n}}{f g (4+m-n)}+\frac {2 (g \cos (e+f x))^{-m-n} (a+a \sin (e+f x))^m (c-c \sin (e+f x))^{-1+n}}{c f g (2+m-n) (4+m-n)}+\frac {2 (g \cos (e+f x))^{-m-n} (a+a \sin (e+f x))^m (c-c \sin (e+f x))^n}{c^2 f g (m-n) (2+m-n) (4+m-n)} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.44, antiderivative size = 204, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 2, integrand size = 45, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.044, Rules used = {2928, 2927}
\begin {gather*} \frac {2 (a \sin (e+f x)+a)^m (c-c \sin (e+f x))^n (g \cos (e+f x))^{-m-n}}{c^2 f g (m-n) (m-n+2) (m-n+4)}+\frac {(a \sin (e+f x)+a)^m (c-c \sin (e+f x))^{n-2} (g \cos (e+f x))^{-m-n}}{f g (m-n+4)}+\frac {2 (a \sin (e+f x)+a)^m (c-c \sin (e+f x))^{n-1} (g \cos (e+f x))^{-m-n}}{c f g (m-n+2) (m-n+4)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2927
Rule 2928
Rubi steps
\begin {align*} \int (g \cos (e+f x))^{-1-m-n} (a+a \sin (e+f x))^m (c-c \sin (e+f x))^{-2+n} \, dx &=\frac {(g \cos (e+f x))^{-m-n} (a+a \sin (e+f x))^m (c-c \sin (e+f x))^{-2+n}}{f g (4+m-n)}+\frac {2 \int (g \cos (e+f x))^{-1-m-n} (a+a \sin (e+f x))^m (c-c \sin (e+f x))^{-1+n} \, dx}{c (4+m-n)}\\ &=\frac {(g \cos (e+f x))^{-m-n} (a+a \sin (e+f x))^m (c-c \sin (e+f x))^{-2+n}}{f g (4+m-n)}+\frac {2 (g \cos (e+f x))^{-m-n} (a+a \sin (e+f x))^m (c-c \sin (e+f x))^{-1+n}}{c f g (2+m-n) (4+m-n)}+\frac {2 \int (g \cos (e+f x))^{-1-m-n} (a+a \sin (e+f x))^m (c-c \sin (e+f x))^n \, dx}{c^2 (2+m-n) (4+m-n)}\\ &=\frac {(g \cos (e+f x))^{-m-n} (a+a \sin (e+f x))^m (c-c \sin (e+f x))^{-2+n}}{f g (4+m-n)}+\frac {2 (g \cos (e+f x))^{-m-n} (a+a \sin (e+f x))^m (c-c \sin (e+f x))^{-1+n}}{c f g (2+m-n) (4+m-n)}+\frac {2 (g \cos (e+f x))^{-m-n} (a+a \sin (e+f x))^m (c-c \sin (e+f x))^n}{c^2 f g (m-n) (2+m-n) (4+m-n)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 28.64, size = 183, normalized size = 0.90 \begin {gather*} \frac {2^{-2+n} \cos (e+f x) (g \cos (e+f x))^{-1-m-n} \sin ^{-4+2 n}\left (\frac {1}{2} \left (-e+\frac {\pi }{2}-f x\right )\right ) \left (\cos \left (\frac {1}{2} (e+f x)\right )-\sin \left (\frac {1}{2} (e+f x)\right )\right )^{-2 (-2+n)} (a+a \sin (e+f x))^m (c-c \sin (e+f x))^{-2+n} \left (3+4 m+m^2-4 n-2 m n+n^2+\cos \left (2 \left (-e+\frac {\pi }{2}-f x\right )\right )-2 (2+m-n) \sin (e+f x)\right )}{f (m-n) (2+m-n) (4+m-n)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [F]
time = 0.39, size = 0, normalized size = 0.00 \[\int \left (g \cos \left (f x +e \right )\right )^{-1-m -n} \left (a +a \sin \left (f x +e \right )\right )^{m} \left (c -c \sin \left (f x +e \right )\right )^{-2+n}\, dx\]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.38, size = 191, normalized size = 0.94 \begin {gather*} -\frac {{\left (2 \, \cos \left (f x + e\right )^{3} + 2 \, {\left (m - n + 2\right )} \cos \left (f x + e\right ) \sin \left (f x + e\right ) - {\left (m^{2} - 2 \, {\left (m + 2\right )} n + n^{2} + 4 \, m + 4\right )} \cos \left (f x + e\right )\right )} \left (g \cos \left (f x + e\right )\right )^{-m - n - 1} {\left (a \sin \left (f x + e\right ) + a\right )}^{m} e^{\left (2 \, {\left (n - 2\right )} \log \left (g \cos \left (f x + e\right )\right ) - {\left (n - 2\right )} \log \left (a \sin \left (f x + e\right ) + a\right ) + {\left (n - 2\right )} \log \left (\frac {a c}{g^{2}}\right )\right )}}{f m^{3} - f n^{3} + 6 \, f m^{2} + 3 \, {\left (f m + 2 \, f\right )} n^{2} + 8 \, f m - {\left (3 \, f m^{2} + 12 \, f m + 8 \, f\right )} n} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 15.65, size = 887, normalized size = 4.35 \begin {gather*} -{\mathrm {e}}^{-e\,3{}\mathrm {i}-f\,x\,3{}\mathrm {i}}\,{\left (c-c\,\left (\frac {{\mathrm {e}}^{-e\,1{}\mathrm {i}-f\,x\,1{}\mathrm {i}}\,1{}\mathrm {i}}{2}-\frac {{\mathrm {e}}^{e\,1{}\mathrm {i}+f\,x\,1{}\mathrm {i}}\,1{}\mathrm {i}}{2}\right )\right )}^{n-2}\,\left (\frac {{\left (a+a\,\left (\frac {{\mathrm {e}}^{-e\,1{}\mathrm {i}-f\,x\,1{}\mathrm {i}}\,1{}\mathrm {i}}{2}-\frac {{\mathrm {e}}^{e\,1{}\mathrm {i}+f\,x\,1{}\mathrm {i}}\,1{}\mathrm {i}}{2}\right )\right )}^m}{4\,f\,{\left (g\,\left (\frac {{\mathrm {e}}^{-e\,1{}\mathrm {i}-f\,x\,1{}\mathrm {i}}}{2}+\frac {{\mathrm {e}}^{e\,1{}\mathrm {i}+f\,x\,1{}\mathrm {i}}}{2}\right )\right )}^{m+n+1}\,\left (m^3-3\,m^2\,n+6\,m^2+3\,m\,n^2-12\,m\,n+8\,m-n^3+6\,n^2-8\,n\right )}+\frac {{\mathrm {e}}^{e\,6{}\mathrm {i}+f\,x\,6{}\mathrm {i}}\,{\left (a+a\,\left (\frac {{\mathrm {e}}^{-e\,1{}\mathrm {i}-f\,x\,1{}\mathrm {i}}\,1{}\mathrm {i}}{2}-\frac {{\mathrm {e}}^{e\,1{}\mathrm {i}+f\,x\,1{}\mathrm {i}}\,1{}\mathrm {i}}{2}\right )\right )}^m}{4\,f\,{\left (g\,\left (\frac {{\mathrm {e}}^{-e\,1{}\mathrm {i}-f\,x\,1{}\mathrm {i}}}{2}+\frac {{\mathrm {e}}^{e\,1{}\mathrm {i}+f\,x\,1{}\mathrm {i}}}{2}\right )\right )}^{m+n+1}\,\left (m^3-3\,m^2\,n+6\,m^2+3\,m\,n^2-12\,m\,n+8\,m-n^3+6\,n^2-8\,n\right )}-\frac {{\mathrm {e}}^{e\,2{}\mathrm {i}+f\,x\,2{}\mathrm {i}}\,{\left (a+a\,\left (\frac {{\mathrm {e}}^{-e\,1{}\mathrm {i}-f\,x\,1{}\mathrm {i}}\,1{}\mathrm {i}}{2}-\frac {{\mathrm {e}}^{e\,1{}\mathrm {i}+f\,x\,1{}\mathrm {i}}\,1{}\mathrm {i}}{2}\right )\right )}^m\,\left (2\,m^2-4\,m\,n+8\,m+2\,n^2-8\,n+5\right )}{4\,f\,{\left (g\,\left (\frac {{\mathrm {e}}^{-e\,1{}\mathrm {i}-f\,x\,1{}\mathrm {i}}}{2}+\frac {{\mathrm {e}}^{e\,1{}\mathrm {i}+f\,x\,1{}\mathrm {i}}}{2}\right )\right )}^{m+n+1}\,\left (m^3-3\,m^2\,n+6\,m^2+3\,m\,n^2-12\,m\,n+8\,m-n^3+6\,n^2-8\,n\right )}-\frac {{\mathrm {e}}^{e\,4{}\mathrm {i}+f\,x\,4{}\mathrm {i}}\,{\left (a+a\,\left (\frac {{\mathrm {e}}^{-e\,1{}\mathrm {i}-f\,x\,1{}\mathrm {i}}\,1{}\mathrm {i}}{2}-\frac {{\mathrm {e}}^{e\,1{}\mathrm {i}+f\,x\,1{}\mathrm {i}}\,1{}\mathrm {i}}{2}\right )\right )}^m\,\left (2\,m^2-4\,m\,n+8\,m+2\,n^2-8\,n+5\right )}{4\,f\,{\left (g\,\left (\frac {{\mathrm {e}}^{-e\,1{}\mathrm {i}-f\,x\,1{}\mathrm {i}}}{2}+\frac {{\mathrm {e}}^{e\,1{}\mathrm {i}+f\,x\,1{}\mathrm {i}}}{2}\right )\right )}^{m+n+1}\,\left (m^3-3\,m^2\,n+6\,m^2+3\,m\,n^2-12\,m\,n+8\,m-n^3+6\,n^2-8\,n\right )}+\frac {{\mathrm {e}}^{e\,1{}\mathrm {i}+f\,x\,1{}\mathrm {i}}\,{\left (a+a\,\left (\frac {{\mathrm {e}}^{-e\,1{}\mathrm {i}-f\,x\,1{}\mathrm {i}}\,1{}\mathrm {i}}{2}-\frac {{\mathrm {e}}^{e\,1{}\mathrm {i}+f\,x\,1{}\mathrm {i}}\,1{}\mathrm {i}}{2}\right )\right )}^m\,\left (m\,2{}\mathrm {i}-n\,2{}\mathrm {i}+4{}\mathrm {i}\right )}{4\,f\,{\left (g\,\left (\frac {{\mathrm {e}}^{-e\,1{}\mathrm {i}-f\,x\,1{}\mathrm {i}}}{2}+\frac {{\mathrm {e}}^{e\,1{}\mathrm {i}+f\,x\,1{}\mathrm {i}}}{2}\right )\right )}^{m+n+1}\,\left (m^3-3\,m^2\,n+6\,m^2+3\,m\,n^2-12\,m\,n+8\,m-n^3+6\,n^2-8\,n\right )}-\frac {{\mathrm {e}}^{e\,5{}\mathrm {i}+f\,x\,5{}\mathrm {i}}\,{\left (a+a\,\left (\frac {{\mathrm {e}}^{-e\,1{}\mathrm {i}-f\,x\,1{}\mathrm {i}}\,1{}\mathrm {i}}{2}-\frac {{\mathrm {e}}^{e\,1{}\mathrm {i}+f\,x\,1{}\mathrm {i}}\,1{}\mathrm {i}}{2}\right )\right )}^m\,\left (m\,2{}\mathrm {i}-n\,2{}\mathrm {i}+4{}\mathrm {i}\right )}{4\,f\,{\left (g\,\left (\frac {{\mathrm {e}}^{-e\,1{}\mathrm {i}-f\,x\,1{}\mathrm {i}}}{2}+\frac {{\mathrm {e}}^{e\,1{}\mathrm {i}+f\,x\,1{}\mathrm {i}}}{2}\right )\right )}^{m+n+1}\,\left (m^3-3\,m^2\,n+6\,m^2+3\,m\,n^2-12\,m\,n+8\,m-n^3+6\,n^2-8\,n\right )}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________